\(\int \frac {(c+d x^2)^2}{x^4 (a+b x^2)} \, dx\) [217]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 22, antiderivative size = 64 \[ \int \frac {\left (c+d x^2\right )^2}{x^4 \left (a+b x^2\right )} \, dx=-\frac {c^2}{3 a x^3}+\frac {c (b c-2 a d)}{a^2 x}+\frac {(b c-a d)^2 \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{a^{5/2} \sqrt {b}} \]

[Out]

-1/3*c^2/a/x^3+c*(-2*a*d+b*c)/a^2/x+(-a*d+b*c)^2*arctan(x*b^(1/2)/a^(1/2))/a^(5/2)/b^(1/2)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {472, 211} \[ \int \frac {\left (c+d x^2\right )^2}{x^4 \left (a+b x^2\right )} \, dx=\frac {\arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right ) (b c-a d)^2}{a^{5/2} \sqrt {b}}+\frac {c (b c-2 a d)}{a^2 x}-\frac {c^2}{3 a x^3} \]

[In]

Int[(c + d*x^2)^2/(x^4*(a + b*x^2)),x]

[Out]

-1/3*c^2/(a*x^3) + (c*(b*c - 2*a*d))/(a^2*x) + ((b*c - a*d)^2*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/(a^(5/2)*Sqrt[b])

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 472

Int[(((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_))/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Int[ExpandIntegr
and[(e*x)^m*((a + b*x^n)^p/(c + d*x^n)), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n
, 0] && IGtQ[p, 0] && (IntegerQ[m] || IGtQ[2*(m + 1), 0] ||  !RationalQ[m])

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {c^2}{a x^4}+\frac {c (-b c+2 a d)}{a^2 x^2}+\frac {(-b c+a d)^2}{a^2 \left (a+b x^2\right )}\right ) \, dx \\ & = -\frac {c^2}{3 a x^3}+\frac {c (b c-2 a d)}{a^2 x}+\frac {(b c-a d)^2 \int \frac {1}{a+b x^2} \, dx}{a^2} \\ & = -\frac {c^2}{3 a x^3}+\frac {c (b c-2 a d)}{a^2 x}+\frac {(b c-a d)^2 \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{a^{5/2} \sqrt {b}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.03 \[ \int \frac {\left (c+d x^2\right )^2}{x^4 \left (a+b x^2\right )} \, dx=-\frac {c^2}{3 a x^3}-\frac {c (-b c+2 a d)}{a^2 x}+\frac {(-b c+a d)^2 \arctan \left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{a^{5/2} \sqrt {b}} \]

[In]

Integrate[(c + d*x^2)^2/(x^4*(a + b*x^2)),x]

[Out]

-1/3*c^2/(a*x^3) - (c*(-(b*c) + 2*a*d))/(a^2*x) + ((-(b*c) + a*d)^2*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/(a^(5/2)*Sqrt
[b])

Maple [A] (verified)

Time = 2.76 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.09

method result size
default \(-\frac {c^{2}}{3 a \,x^{3}}-\frac {c \left (2 a d -b c \right )}{a^{2} x}+\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{a^{2} \sqrt {a b}}\) \(70\)
risch \(\frac {-\frac {c \left (2 a d -b c \right ) x^{2}}{a^{2}}-\frac {c^{2}}{3 a}}{x^{3}}+\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (a^{5} \textit {\_Z}^{2} b +a^{4} d^{4}-4 a^{3} b c \,d^{3}+6 a^{2} b^{2} c^{2} d^{2}-4 a \,b^{3} c^{3} d +b^{4} c^{4}\right )}{\sum }\textit {\_R} \ln \left (\left (3 \textit {\_R}^{2} a^{5} b +2 a^{4} d^{4}-8 a^{3} b c \,d^{3}+12 a^{2} b^{2} c^{2} d^{2}-8 a \,b^{3} c^{3} d +2 b^{4} c^{4}\right ) x +\left (-a^{5} d^{2}+2 b c d \,a^{4}-a^{3} b^{2} c^{2}\right ) \textit {\_R} \right )\right )}{2}\) \(192\)

[In]

int((d*x^2+c)^2/x^4/(b*x^2+a),x,method=_RETURNVERBOSE)

[Out]

-1/3*c^2/a/x^3-c*(2*a*d-b*c)/a^2/x+(a^2*d^2-2*a*b*c*d+b^2*c^2)/a^2/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 190, normalized size of antiderivative = 2.97 \[ \int \frac {\left (c+d x^2\right )^2}{x^4 \left (a+b x^2\right )} \, dx=\left [-\frac {3 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {-a b} x^{3} \log \left (\frac {b x^{2} - 2 \, \sqrt {-a b} x - a}{b x^{2} + a}\right ) + 2 \, a^{2} b c^{2} - 6 \, {\left (a b^{2} c^{2} - 2 \, a^{2} b c d\right )} x^{2}}{6 \, a^{3} b x^{3}}, \frac {3 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {a b} x^{3} \arctan \left (\frac {\sqrt {a b} x}{a}\right ) - a^{2} b c^{2} + 3 \, {\left (a b^{2} c^{2} - 2 \, a^{2} b c d\right )} x^{2}}{3 \, a^{3} b x^{3}}\right ] \]

[In]

integrate((d*x^2+c)^2/x^4/(b*x^2+a),x, algorithm="fricas")

[Out]

[-1/6*(3*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*sqrt(-a*b)*x^3*log((b*x^2 - 2*sqrt(-a*b)*x - a)/(b*x^2 + a)) + 2*a^2*
b*c^2 - 6*(a*b^2*c^2 - 2*a^2*b*c*d)*x^2)/(a^3*b*x^3), 1/3*(3*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*sqrt(a*b)*x^3*arc
tan(sqrt(a*b)*x/a) - a^2*b*c^2 + 3*(a*b^2*c^2 - 2*a^2*b*c*d)*x^2)/(a^3*b*x^3)]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 172 vs. \(2 (56) = 112\).

Time = 0.37 (sec) , antiderivative size = 172, normalized size of antiderivative = 2.69 \[ \int \frac {\left (c+d x^2\right )^2}{x^4 \left (a+b x^2\right )} \, dx=- \frac {\sqrt {- \frac {1}{a^{5} b}} \left (a d - b c\right )^{2} \log {\left (- \frac {a^{3} \sqrt {- \frac {1}{a^{5} b}} \left (a d - b c\right )^{2}}{a^{2} d^{2} - 2 a b c d + b^{2} c^{2}} + x \right )}}{2} + \frac {\sqrt {- \frac {1}{a^{5} b}} \left (a d - b c\right )^{2} \log {\left (\frac {a^{3} \sqrt {- \frac {1}{a^{5} b}} \left (a d - b c\right )^{2}}{a^{2} d^{2} - 2 a b c d + b^{2} c^{2}} + x \right )}}{2} + \frac {- a c^{2} + x^{2} \left (- 6 a c d + 3 b c^{2}\right )}{3 a^{2} x^{3}} \]

[In]

integrate((d*x**2+c)**2/x**4/(b*x**2+a),x)

[Out]

-sqrt(-1/(a**5*b))*(a*d - b*c)**2*log(-a**3*sqrt(-1/(a**5*b))*(a*d - b*c)**2/(a**2*d**2 - 2*a*b*c*d + b**2*c**
2) + x)/2 + sqrt(-1/(a**5*b))*(a*d - b*c)**2*log(a**3*sqrt(-1/(a**5*b))*(a*d - b*c)**2/(a**2*d**2 - 2*a*b*c*d
+ b**2*c**2) + x)/2 + (-a*c**2 + x**2*(-6*a*c*d + 3*b*c**2))/(3*a**2*x**3)

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.09 \[ \int \frac {\left (c+d x^2\right )^2}{x^4 \left (a+b x^2\right )} \, dx=\frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} a^{2}} - \frac {a c^{2} - 3 \, {\left (b c^{2} - 2 \, a c d\right )} x^{2}}{3 \, a^{2} x^{3}} \]

[In]

integrate((d*x^2+c)^2/x^4/(b*x^2+a),x, algorithm="maxima")

[Out]

(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a^2) - 1/3*(a*c^2 - 3*(b*c^2 - 2*a*c*d)*x^2)/
(a^2*x^3)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.12 \[ \int \frac {\left (c+d x^2\right )^2}{x^4 \left (a+b x^2\right )} \, dx=\frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} a^{2}} + \frac {3 \, b c^{2} x^{2} - 6 \, a c d x^{2} - a c^{2}}{3 \, a^{2} x^{3}} \]

[In]

integrate((d*x^2+c)^2/x^4/(b*x^2+a),x, algorithm="giac")

[Out]

(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a^2) + 1/3*(3*b*c^2*x^2 - 6*a*c*d*x^2 - a*c^2
)/(a^2*x^3)

Mupad [B] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.41 \[ \int \frac {\left (c+d x^2\right )^2}{x^4 \left (a+b x^2\right )} \, dx=\frac {b\,c^2}{a^2\,x}-\frac {c^2}{3\,a\,x^3}+\frac {b^{3/2}\,c^2\,\mathrm {atan}\left (\frac {\sqrt {b}\,x}{\sqrt {a}}\right )}{a^{5/2}}+\frac {d^2\,\mathrm {atan}\left (\frac {\sqrt {b}\,x}{\sqrt {a}}\right )}{\sqrt {a}\,\sqrt {b}}-\frac {2\,c\,d}{a\,x}-\frac {2\,\sqrt {b}\,c\,d\,\mathrm {atan}\left (\frac {\sqrt {b}\,x}{\sqrt {a}}\right )}{a^{3/2}} \]

[In]

int((c + d*x^2)^2/(x^4*(a + b*x^2)),x)

[Out]

(b*c^2)/(a^2*x) - c^2/(3*a*x^3) + (b^(3/2)*c^2*atan((b^(1/2)*x)/a^(1/2)))/a^(5/2) + (d^2*atan((b^(1/2)*x)/a^(1
/2)))/(a^(1/2)*b^(1/2)) - (2*c*d)/(a*x) - (2*b^(1/2)*c*d*atan((b^(1/2)*x)/a^(1/2)))/a^(3/2)